<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@page import="com.printeverywhere.dto.User"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<link href="../Admin-CSS/style.css" rel="stylesheet" type="text/css" />

<script>
function checkall(formname,checkname,thestate){
var el_collection=eval("document.forms."+formname+"['"+checkname+"']")
for (c=0;c<el_collection.length;c++)
el_collection[c].checked=thestate
}
</script>
		<s:actionerror cssClass="Note-red" />
	<table width="100%">
		<tr>
			<td height="40" colspan="2" class="sectionheading bottom-border" align="left">Pending Accounts</td>
		</tr>
		<tr><td colspan="2">&nbsp;</td></tr>
	<s:form  method="post" action="searchPendingAccounts" id="form" namespace="/admin" theme="simple">
		<tr>
			<td colspan="2">
				<table width="100%">
					<tr align="left">
						<td class="verdana12blacknormal">Search for:</td>
						<td nowrap="nowrap" class="verdana12blacknormal">
								<s:textfield name="searchString" theme="simple" cssClass="Textfiled-border" />
						</td>
						<td nowrap="nowrap" class="verdana12blacknormal">
							<s:select list="accountSearchList" name="criteria" theme="simple" listKey="key" listValue="value" cssClass="Textfiled-border" />
						</td>
						<td class="verdana12blacknormal">
							<s:submit value="Search" name="operation" type="image" src="../Admin-Images/search-btn.gif" theme="simple" title="Search"/>
						</td>
						<td>
							<s:a href="showResendConfirmation.htm" cssClass="navi-link">Resend Confirmation</s:a>
						</td>
						<td><s:a href="showPendingAccounts.htm" cssClass="navi-link">Update Counts </s:a></td>
					</tr>
				</table>
			</td>
		</tr>
	</s:form>
		<tr>
			<td colspan="2"><p><span class="verdana12blacknormal"><s:text name="label.system.Accounts" /> </span></p></td>
		</tr>
		<tr><td colspan="2"><jsp:include page="AtoZAccounts.jsp" /></td></tr>
		<tr><td colspan="2">&nbsp;</td></tr>
	<s:form name="activePendingAccounts" method="post" action="activePendingAccounts" id="form" namespace="/admin" theme="simple">
		<s:if test="list.size != 0">
		<tr>
			<td colspan="2">
				<display:table name="list" pagesize="5" cellpadding="0" cellspacing="0" requestURI="showPendingAccounts.htm" id="row" class="verdana12blacknormal">
					<display:column title="#" headerClass="Table-Head">
						<c:out value="${row_rowNum}" />
					</display:column>
					<display:column headerClass="Table-Head" property="userId" title="Account" autolink="true" href="accountDetails.htm" paramId="accountDetailid" paramProperty="id" class="navi-link" />
					<display:column headerClass="Table-Head" value="Euro25.00000" title="Balance" autolink="true" />
					<display:column headerClass="Table-Head" property="email" autolink="true"
						titleKey="label.system.Email" class="navi-link" />
					<display:column headerClass="Table-Head"
						title="Manage"
						 class="navi-link" >
						<s:a href="editUser.htm?userId=%{#attr.row.id}&adminaction=showPendingAccounts" cssClass="navi-link">
							Manage
						</s:a>
					</display:column>
					<display:column headerClass="Table-Head" title="Delete">
						<input type="checkbox" id="delete" name="delete"
							value="<%=((User) row).getId()%>">
					</display:column>
					<display:column headerClass="Table-Head" title="Status">
					<input type="checkbox" id="active"
										name="active" value="<%=((User) row).getId()%>" <%= ((User) row).isChecked() ? "checked" : "" %>>
						<input type="hidden" name="checkedId" value="<%=((User) row).getId()%>">
					</display:column>
				</display:table>
			</td>
		</tr>
			<tr><td colspan="2">&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
			<tr>
				<td>
					<table class="verdana12blacknormal" width="100%">
						<tr>
							<td>
								<img style="cursor: pointer;"
									onclick="javascript:checkall('activePendingAccounts','delete',true)"
									src="../Admin-Images/check-all-delete-btn.gif" alt="Check All Delete" title="Check All Delete">

								<img style="cursor: pointer;"
									onclick="javascript:checkall('activePendingAccounts','delete',false)"
									src="../Admin-Images/un-check-all-delete-btn.gif"
									alt="Uncheck All Delete" title="Uncheck All Delete">

								<img style="cursor: pointer;"
									onclick="javascript:checkall('activePendingAccounts','active',true)"
									src="../Admin-Images/check-all-states-btn.gif"
									alt="Check All Status" title="Check All Status">
								<img style="cursor: pointer;"
									onclick="javascript:checkall('activePendingAccounts','active',false)"
									src="../Admin-Images/un-check-all-states-btn.gif"
									alt="UnCheck All Status" title="UnCheck All Status">
							</td>
						</tr>
						<tr>
							<td>
								<br>
								<s:submit theme="simple" type="image" src="../Admin-Images/submit-btn.gif" value="Submit" name="submit" />
								<img style="cursor: pointer;"
									onclick="document.getElementById('form').reset();"
									src="../Admin-Images/reset-button.gif" alt="Reset" title="Reset">
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</s:if>
		</s:form>
	</table>
